import layoutHeaderAside from '@/layout/header-aside'
// 由于懒加载页面太多的话会造成webpack热更新太慢，所以开发环境不使用懒加载，只有生产环境使用懒加载
const _import = require('@/libs/util.import.' + process.env.NODE_ENV)
/**
 * 在主框架内显示
 */
const frameIn = [
  {
    path: '/',
    redirect: { name: 'index' },
    component: layoutHeaderAside,
    children: [
      // 首页
      {
        path: 'index',
        name:'index',
        meta: {
          title:'首页',
          auth: true
        },
        component: _import('permissions/AdminHome')
      },
      {
        path: 'Launch_event',
        name:'Launch_event',
        meta: {
          title: '发布任务',
          auth: true
        },
        component: _import('permissions/Launch_event')
      },
      {
        path: 'Admin_adv',
        name:'Admin_adv',
        meta: {
          title: '平台公告',
          auth: true
        },
        component: _import('permissions/Admin_adv')
      },
      {
        path: 'task_PDD',
        name:'task_PDD',
        meta: {
          title: '拼多多活动',
          auth: true
        },
        component: _import('permissions/Admin_task_PDD')
      },
      {
        path: 'KDprice',
        name:'KDprice',
        meta: {
          title: '价格列表',
          auth: true
        },
        component: _import('permissions/KDprice')
      },
      {
        path: 'task_DY',
        name:'task_DY',
        meta: {
          title: '抖音活动',
          auth: true
        },
        component: _import('permissions/Admin_task_DY')
      },
      {
        path: 'List_Agents',
        name: 'List_Agents',
        meta: {
          title: '商家详情',
          auth: true
        },
        component: _import('permissions/List-Agents')
      },
      {
        path: 'task',
        name: 'task',
        meta: {
          title: '淘宝活动',
          auth: true
        },
        component: _import('permissions/AdminTask')
      },
      {
        path: 'freeCreatorder',
        name: 'freeCreatorder',
        meta: {
          title: '创建订单',
          auth: true
        },
        component: _import('permissions/freeCreatorder')
      },
      {
        path: 'Admin_collection',
        name: 'Admin_collection',
        meta: {
          title: '催收列表',
          auth: true
        },
        component: _import('permissions/Admin_collection')
      },
      {
        path: 'OrderListGood',
        name: 'OrderListGood',
        meta: {
          title: '订单列表',
          auth: true
        },
        component: _import('permissions/OrderListGood')
      },
      {
        path: 'address',
        name: 'address',
        meta: {
          title: '发货地址',
          auth: true
        },
        component: _import('permissions/address')
      },
      {
        path: 'List-Agents',
        name: 'List-Agents',
        meta: {
          title: '代理价格',
          auth: true
        },
        component: _import('permissions/List-Agents')
      },
      {
        path: 'evaluation',
        name: 'evaluation',
        meta: {
          title: '评论列表',
          auth: true
        },
        component: _import('permissions/AdminEvaluation')
      },
      {
        path: 'Specify_evaluation_audit',
        name: 'Specify_evaluation_audit',
        meta: {
          title: '指定评价审核列表',
          auth: true
        },
        component: _import('permissions/Specify_evaluation_audit')
      },
      {
        path: 'price',
        name: 'price',
        meta: {
          title: '价格列表',
          auth: true
        },
        component: _import('permissions/Admin_price')
      },
      {
        path: 'otherList',
        name: 'otherList',
        meta: {
          title: '额外任务订单审核',
          auth: true
        },
        component: _import('permissions/otherList')
      },
      {
        path: 'OtherActivity',
        name: 'OtherActivity',
        meta: {
          title: '其他活动',
          auth: true
        },
        component: _import('permissions/OtherActivity')
      },
      {
        path: 'taskInfo',
        name: 'taskInfo',
        meta: {
          title: '订单明细',
          auth: true
        },
        component: _import('permissions/AdminTaskInfo')
      },
      {
        path: 'Merchant',
        name: 'Merchant',
        meta: {
          title: '邀请商家',
          auth: true
        },
        component: _import('permissions/Admin_Merchant')
      },
      {
        path: 'noticelist',
        name: 'noticelist',
        meta: {
          title: '公告',
          auth: true
        },
        component: _import('permissions/noticelist')
      },
      {
        path: 'refundList',
        name: 'refundList',
        meta: {
          title: '投诉中心',
          auth: true
        },
        component: _import('permissions/AdminRefundList')
      },
      {
        path: 'orderlist',
        name: 'orderlist',
        meta: {
          title: '订单审核',
          auth: true
        },
        component: _import('permissions/order_List')
      },
      {
        path: 'evaluatelist',
        name: 'evaluatelist',
        meta: {
          title: '评价审核',
          auth: true
        },
        component: _import('permissions/evaluate_List')
      },
      {
        path: 'accountrecharge',
        name: 'accountrecharge',
        meta: {
          title: '账户充值',
          auth: true
        },
        component:_import('permissions/AccountRecharge')
      },
      {
        path: 'passwordsetting',
        name: 'passwordsetting',
        meta: {
          title: '修改密码',
          auth: true
        },
        component:_import('permissions/PasswordSetting')
      },
      {
        path: 'fundsmanagement',
        name: 'fundsmanagement',
        meta: {
          title: '资金管理',
          auth: true
        },
        component:_import('permissions/FundsManagement')
      },
      {
        path: 'inform',
        name: 'inform',
        meta: {
          title: '使用说明',
          auth: true
        },
        component:_import('permissions/AdminInform')
      },
      {
        path: 'bindingshops',
        name: 'bindingshops',
        meta: {
          title: '绑定店铺',
          auth: true
        },
        component:_import('permissions/BindingShops')
      },
    ]
  },
]
/**
 * 在主框架之外显示
 */
const frameOut = [
  // 首页
  {
    path: '/login',
    name: 'login',
    component: _import('permissions/index')
  },
  {
    path: '/Admin_Login',
    name: 'Admin_Login',
    component: _import('permissions/Admin_Login')
  },
]
/**
 * 错误页面
 */
const errorPage = [
  {
    path: '*',
    name: '404',
    component: _import('system/error/404')
  }
]
// 导出需要显示菜单的
export const frameInRoutes = frameIn

// 重新组织后导出
export default [
  ...frameIn,
  ...frameOut,
  ...errorPage
]
